import { network } from '@/utils';
import { DetailInfoParams } from './data';

import { business } from '../../../../../config/Apis';

export async function queryAreaFunctionList(params: { id: number }) {
  return network.get(business.gardenBiz, { params });
}

export async function queryGardenList(params: any) {
  params = {
    ...params,
    pageIndex: 1,
    pageSize: 1000,
  };

  return network.get(business.garden_list, { params });
}

export async function operSaveOrUpdate(params: DetailInfoParams) {
  return params.id
    ? network.put(business.gardenBiz, { data: params })
    : network.post(business.gardenBiz, { data: params });
}
